<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<div id="fore-home">
    <div class="home-box">
        <h2 class="nav-name"><span class="re-fresh" for="home">首页</span></h2>

        <div class="container box-show">
            <div class="row">
                <div class="col-sm-4">
                    <div class="box-block">
                        <div class="block-body" id="plant-crop-ratio"></div>
                        <div class="block-foot text-center">作物种植比例</div>
                    </div>
                </div>
                <div class="col-sm-4">
                    <div class="box-block">
                        <div class="block-body" id="buyer-place-ratio"></div>
                        <div class="block-foot text-center">买家下单比例</div>
                    </div>
                </div>
                <div class="col-sm-4">
                    <div class="box-block">
                        <div class="block-body" id="crop-sales-ratio"></div>
                        <div class="block-foot text-center">作物销量比例</div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-12">
                    <div class="box-block">
                        <div class="block-body" id="plant-crop-trend"></div>
                        <div class="block-foot text-center">作物种植热度走势图</div>
                    </div>
                </div>
                <div class="col-sm-12">
                    <div class="box-block">
                        <div class="block-body" id="buyer-place-trend"></div>
                        <div class="block-foot text-center">买家下单数量走势图</div>
                    </div>
                </div>
                <div class="col-sm-12">
                    <div class="box-block">
                        <div class="block-body" id="crop-sales-trend"></div>
                        <div class="block-foot text-center">作物销量走势图</div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script type="text/javascript">
        <%--作物种植比例--%>
        var block_body = document.getElementById("plant-crop-ratio");
        var my_echarts = echarts.init(block_body);
        option = {
            title: {
                text: '作物种植比例'
            },
            tooltip : {
                trigger: 'item',
                formatter: "{b} : {c} ({d}%)"
            },
            legend: {
                orient: 'vertical',
                left: 'right',
                data: ['大豆','番茄','花生','玉米','茄子']
            },
            series : [
                {
                    type: 'pie',
                    radius : '80%',
                    center: ['50%', '50%'],
                    data:[
                        {value:335, name:'大豆'},
                        {value:310, name:'番茄'},
                        {value:234, name:'花生'},
                        {value:135, name:'玉米'},
                        {value:1548, name:'茄子'}
                    ],
                    itemStyle: {
                        emphasis: {
                            shadowBlur: 10,
                            shadowOffsetX: 0,
                            shadowColor: 'rgba(0, 0, 0, 0.5)'
                        }
                    }
                }
            ]
        };
        my_echarts.setOption(option);

        <%--买家下单比例--%>
        block_body = document.getElementById("buyer-place-ratio");
        my_echarts = echarts.init(block_body);
        option = {
            title: {
                text: '买家下单比例'
            },
            tooltip : {
                trigger: 'item',
                formatter: "{b} : {c} ({d}%)"
            },
            legend: {
                orient: 'vertical',
                left: 'right',
                data: ['大豆','番茄','花生','玉米','茄子']
            },
            series : [
                {
                    type: 'pie',
                    radius : '80%',
                    center: ['50%', '50%'],
                    data:[
                        {value:2335, name:'大豆'},
                        {value:1310, name:'番茄'},
                        {value:2234, name:'花生'},
                        {value:5135, name:'玉米'},
                        {value:1548, name:'茄子'}
                    ],
                    itemStyle: {
                        emphasis: {
                            shadowBlur: 10,
                            shadowOffsetX: 0,
                            shadowColor: 'rgba(0, 0, 0, 0.5)'
                        }
                    }
                }
            ]
        };
        my_echarts.setOption(option);

        <%--作物销量比例--%>
        block_body = document.getElementById("crop-sales-ratio");
        my_echarts = echarts.init(block_body);
        option = {
            title: {
                text: '作物销量比例'
            },
            tooltip : {
                trigger: 'item',
                formatter: "{b} : {c} ({d}%)"
            },
            legend: {
                orient: 'vertical',
                left: 'right',
                data: ['大豆','番茄','花生','玉米','茄子']
            },
            series : [
                {
                    type: 'pie',
                    radius : '80%',
                    center: ['50%', '50%'],
                    data:[
                        {value:2335, name:'大豆'},
                        {value:1310, name:'番茄'},
                        {value:2234, name:'花生'},
                        {value:5135, name:'玉米'},
                        {value:1548, name:'茄子'}
                    ],
                    itemStyle: {
                        emphasis: {
                            shadowBlur: 10,
                            shadowOffsetX: 0,
                            shadowColor: 'rgba(0, 0, 0, 0.5)'
                        }
                    }
                }
            ]
        };
        my_echarts.setOption(option);

        <%--作物种植热度走势图--%>
        block_body = document.getElementById("plant-crop-trend");
        my_echarts = echarts.init(block_body);
        option = {
            title: {
                text: '作物种植热度走势图'
            },
            tooltip: {
                trigger: 'axis'
            },
            legend: {
                data:['茄子','花生','大豆','玉米','番茄']
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            toolbox: {
                feature: {
                    saveAsImage: {}
                }
            },
            xAxis: {
                type: 'category',
                boundaryGap: false,
                data: ['周一','周二','周三','周四','周五','周六','周日']
            },
            yAxis: {
                type: 'value'
            },
            series: [
                {
                    name:'茄子',
                    type:'line',
                    stack: '总量',
                    data:[120, 132, 101, 134, 90, 230, 210]
                },
                {
                    name:'花生',
                    type:'line',
                    stack: '总量',
                    data:[220, 182, 191, 234, 290, 330, 310]
                },
                {
                    name:'大豆',
                    type:'line',
                    stack: '总量',
                    data:[150, 232, 201, 154, 190, 330, 410]
                },
                {
                    name:'玉米',
                    type:'line',
                    stack: '总量',
                    data:[320, 332, 301, 334, 390, 330, 320]
                },
                {
                    name:'番茄',
                    type:'line',
                    stack: '总量',
                    data:[820, 932, 901, 934, 1290, 1330, 1320]
                }
            ]
        };
        my_echarts.setOption(option);

        <%--买家下单数量走势图--%>
        block_body = document.getElementById("buyer-place-trend");
        my_echarts = echarts.init(block_body);
        option = {
            title: {
                text: '买家下单数量走势图'
            },
            tooltip: {
                trigger: 'axis'
            },
            legend: {
                data:['茄子','花生','大豆','玉米','番茄']
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            toolbox: {
                feature: {
                    saveAsImage: {}
                }
            },
            xAxis: {
                type: 'category',
                boundaryGap: false,
                data: ['周一','周二','周三','周四','周五','周六','周日']
            },
            yAxis: {
                type: 'value'
            },
            series: [
                {
                    name:'茄子',
                    type:'line',
                    stack: '总量',
                    data:[120, 132, 101, 134, 90, 230, 210]
                },
                {
                    name:'花生',
                    type:'line',
                    stack: '总量',
                    data:[220, 182, 191, 234, 290, 330, 310]
                },
                {
                    name:'大豆',
                    type:'line',
                    stack: '总量',
                    data:[150, 232, 201, 154, 190, 330, 410]
                },
                {
                    name:'玉米',
                    type:'line',
                    stack: '总量',
                    data:[320, 332, 301, 334, 390, 330, 320]
                },
                {
                    name:'番茄',
                    type:'line',
                    stack: '总量',
                    data:[820, 932, 901, 934, 1290, 1330, 1320]
                }
            ]
        };
        my_echarts.setOption(option);

        <%--作物销量走势图--%>
        block_body = document.getElementById("crop-sales-trend");
        my_echarts = echarts.init(block_body);
        option = {
            title: {
                text: '作物销量走势图'
            },
            tooltip: {
                trigger: 'axis'
            },
            legend: {
                data:['茄子','花生','大豆','玉米','番茄']
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            toolbox: {
                feature: {
                    saveAsImage: {}
                }
            },
            xAxis: {
                type: 'category',
                boundaryGap: false,
                data: ['周一','周二','周三','周四','周五','周六','周日']
            },
            yAxis: {
                type: 'value'
            },
            series: [
                {
                    name:'茄子',
                    type:'line',
                    stack: '总量',
                    data:[120, 132, 101, 134, 90, 230, 210]
                },
                {
                    name:'花生',
                    type:'line',
                    stack: '总量',
                    data:[220, 182, 191, 234, 290, 330, 310]
                },
                {
                    name:'大豆',
                    type:'line',
                    stack: '总量',
                    data:[150, 232, 201, 154, 190, 330, 410]
                },
                {
                    name:'玉米',
                    type:'line',
                    stack: '总量',
                    data:[320, 332, 301, 334, 390, 330, 320]
                },
                {
                    name:'番茄',
                    type:'line',
                    stack: '总量',
                    data:[820, 932, 901, 934, 1290, 1330, 1320]
                }
            ]
        };
        my_echarts.setOption(option);

    </script>
</div>
